<?php

class ActivityFactory {	
	
	public static function getActivity($activity) {		
		if($activity['activity_name'] == 'CreateHiveTable') {
			$activityObj = new CreateHiveTable($activity);
		}
		elseif($activity['activity_name'] == 'FilterHiveTable') {
			$activityObj = new FilterHiveTable($activity);
		}
		elseif($activity['activity_name'] == 'CreateMysqlTable') {
			$activityObj = new CreateMysqlTable($activity);
		}
		elseif($activity['activity_name'] == 'HiveToMysql') {
			$activityObj = new HiveToMysql($activity);
		}
		elseif($activity['activity_name'] == 'HiveToRemoteFile') {
			$activityObj = new HiveToRemoteFile($activity);
		}
		elseif($activity['activity_name'] == 'Transfer') {
			$activityObj = new Transfer($activity);
		}
		elseif ($activity['activity_type'] == ActivityType::MapRed) {
			$activityObj = new MapRedActivity($activity);
		}
		elseif ($activity['activity_type'] == ActivityType::Shell) {
			$activityObj = new ShellActivity($activity);
		}
		else if ($activity['activity_type'] == ActivityType::Executable){
			$activityObj = new ExecutableActivity($activity);
		}
		return $activityObj;
	}
}